﻿using Domain.Entities;
using FluentMigrator;
using FrameworkCore.Extensions;
using FrameworkCore.Migrations.Data;

namespace Domain.Migrations;

[Migration(202408301701)]
public class CreateTableForGroupMap : ForwardOnlyMigration
{
    public override void Up()
    {
        Create
            .Table(MigrationExpressions.TableNameFor<GroupMap>())
            .WithColumn(typeof(GroupMap).GetColumnName(nameof(IEntity<long>.Id)))
            .AsInt64().PrimaryKey().WithColumnDescription("主键")
            .WithColumn(nameof(GroupMap.GroupId)).AsInt64().WithColumnDescription("组唯一标识")
            .WithColumn(nameof(GroupMap.MapId)).AsInt64().WithColumnDescription("其它表与组映射的唯一标识");
    }
}
